package bsc.war.form;

import bsc.ejb.entity.Person;
import bsc.ejb.metadata.Comparation;
import bsc.ejb.metadata.Comparation.Type;
import bsc.ejb.metadata.Framework;
import bsc.war.delegate.DelegateBSC;
import bsc.war.factory.Factory;
import bsc.war.service.ScoreCardUtils;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.view.RedirectView;

/**
 *
 * @author castrosalazar
 */
public class Logout extends AbstractController {

    @Override
    protected ModelAndView handleRequestInternal(
            HttpServletRequest request,
            HttpServletResponse response) throws Exception
    {
        try
        {
            HttpSession session = request.getSession(true);
            session.removeAttribute("date");
            session.removeAttribute("comparation");
            session.removeAttribute("person");
        } catch (Exception e)
        {
            logger.error("Caught exception: ",e);
            e.printStackTrace();
        }

        return new ModelAndView(new RedirectView(request.getContextPath()));
    }
}